import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'nameFilter'
})
export class NameFilterPipe implements PipeTransform {

  transform(employees, term?: string): any {
    if (term) {
      return employees.filter((employee) => employee.name.toLowerCase().includes(term.toLowerCase()));
    } else {
      return employees;
    }
  }

}
